package com.edu.controller;

import com.edu.Result;
import com.edu.StatusCode;
import com.edu.pojo.EduMenu;
import com.edu.service.EduMenuService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 菜单控制层
 *
 * @author dell
 */
@RestController
@RequestMapping("/menu")
public class EduMenuController {

    @Autowired
    private EduMenuService eduMenuService;

    @GetMapping("/all")
    public Result findAll(){
        List<EduMenu> menuList = eduMenuService.findAll();
        return new Result(true, StatusCode.OK, "查询成功!", menuList);
    }

    @GetMapping("/list")
    public Result findMenu(){
        List<EduMenu> menuList = eduMenuService.findMenu();
        return new Result(true, StatusCode.OK, "查询成功!", menuList);
    }
}
